package lab01;

public class Test13 {
    public static void main(String[] args) {
        int gw,sw,bw,qw;
        int count = 0;
        for(int i = 1;i <= 1000;i ++){
            qw = i/1000;
            bw = (i%1000)/100;
            sw = (i%100)/10;
            gw = i%10;

            if(qw!=0){
                count = 4;
            }else if(bw != 0){
                count = 3;
            }else if(sw != 0){
                count = 2;
            }else {
                count = 1;
            }

            if(count == 3){
                if(bw*bw*bw+sw*sw*sw+gw*gw*gw == i){
                    System.out.println(i+"是水仙花数！");
                }
            }

        }
    }
}
